package com.ydd.mapper;


import com.github.pagehelper.Page;
import com.ydd.dto.CatePageQueryDTO;
import com.ydd.entity.YddCate;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface CateMapper {


    @Insert("insert into ydd_cate (catename,icon,sort_num) values (#{catename},#{icon},#{sort_num})")
    void addCate(YddCate yddCate);


    Page<YddCate> pageQuery(CatePageQueryDTO catePageQueryDTO);

    @Delete("delete from ydd_cate where id = #{id}")
    void deleteById(Integer id);
    

    @Select("select * from ydd_cate where id=#{id}")
    YddCate rowInfo(String id);

    void update(YddCate yddCate);

    @Select("select * from ydd_cate")
    List<YddCate> getAll();
    @Select("select * from ydd_cate where id=#{cateId}")
    List<YddCate> getId(Integer cateId);

    @Select("select ydd_cate.catename from ydd_cate where id=#{id}")
    String getCatename(Integer id);


    //分页查询
   // Page<YddTag> pageQuery(TabPageQueryDTO tabPageQueryDTO);
}
